<?php
// error_reporting(E_ALL);
// ini_set("display_errors","On");

//就近 www.jiujin.me
if (!defined('IN_IA')) {
	die('Access Denied');
}
global $_W, $_GPC;
$id=$_GPC['log_id'];
$openid = m('user')->getOpenid();
$member = m('member')->getInfo($openid);
$mid=$member['id'];
$row=pdo_fetch('select * from'.tablename('ewei_shop_commission_gift_log').' where uniacid=:uniacid and id=:id',array(':uniacid'=>$_W['uniacid'],':id'=>$id));
if(!empty($_POST['id'])){
  $log=pdo_fetch('select * from'.tablename('ewei_shop_commission_gift_log').' where uniacid=:uniacid and id=:id',array(':uniacid'=>$_W['uniacid'],':id'=>$_POST['id']));
  $money=$member['gift_card']+$log['money'];
  pdo_update('ewei_shop_commission_gift_log',array('status'=>1,'gettime'=>time(),'openid'=>$member['openid']),array('uniacid'=>$_W['uniacid'],'id'=>$_POST['id']));
  pdo_update('mc_members',array('gift_card'=>$money),array('uniacid'=>$_W['uniacid'],'uid'=>$member['uid']));
}
include $this->template('gift/list');

